46a4070f841b2d2463cdc683aa17dd546285b610,app/src/main/java/com/topjohnwu/magisk/utils/Utils.java,Utils,itemExist,#boolean#String#,32
Before Change
public static boolean itemExist(boolean root, String path) {
String command = "if [ -e " + path + " ]; then echo true; else echo false; fi";
if (Shell.rootAccess() && root) {
return Boolean.parseBoolean(Shell.su(command).get(0));
} else {
return new File(path).exists();
}
After Change
String command = "if [ -e " + path + " ]; then echo true; else echo false; fi";
List<String> ret;
if (Shell.rootAccess() && root) {
ret = Shell.su(command);
return isValidShellResponse(ret) && Boolean.parseBoolean(ret.get(0));
} else {
return new File(path).exists();
}